export const debounce = function (fun: any, delay: number) {
  let timer: any
  return function (...args: any) {
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      fun(args)
    }, delay)
  }
}
